import React, {Component} from 'react'
import {BrowserRouter, Route} from 'react-router-dom'
import App from '@/app'
import Login from '@/component/Login'
import Detail from '@/component/Detail'
import Admin from '@/admin'
import Ui from '@/component/Ui'
import Form from '@/component/Form'
import NoMatch from '@/component/NoMatch'


class Router extends Component {

    render() {
        return (
            <div>
                <BrowserRouter>
                    <App>
                       <Route path='/admin' render={()=>
                           <Admin>
                               <Route path={'/admin/ui'} component={Ui}/>
                               <Route path={'/admin/form'} component={Form}/>
                           </Admin>
                       }/>
                        <Route exact path='/login' component={Login}/>
                        <Route exact path='/detail' component={Detail}/>
                        <Route component={NoMatch}/>
                    </App>
                </BrowserRouter>
            </div>
        )
    }
}



export default Router
